﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ENG.TeachersDiary
{
  static class Extensions
  {
    public static int GetPropertyRowIndex(this System.Windows.Forms.DataGridView grd, string propertyName)
    {
      int ret = -1;

      for (int i = 0; i < grd.Columns.Count; i++)
      {
        if (grd.Columns[i].DataPropertyName == propertyName)
        {
          ret = i;
          break;
        }
      } // foreach (var fItem in grd.Columns)

      return ret;
    }
  }
}
